package com.ruoyi.facilityInfo.domain;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum Status {


    UNUSE("0","未使用"),
    INUSE("1","使用中"),
    INFAULT("2","故障中"),
    INREPAIR("3","维修中");

    private final String num;
    private final String name;

    public static void changeTostatus(FacilityInfo facilityInfo) {
        for (Status status : Status.values()) {
            if (facilityInfo.getFacilityStatus().equals(status.getNum())) {
                facilityInfo.setFacilityStatus(status.getName());
            }
        }
    }
    public static void changeTonums(FacilityInfo facilityInfo) {
        for (Status status : Status.values()) {
            if (facilityInfo.getFacilityStatus().equals(status.getName())) {
                facilityInfo.setFacilityStatus(status.getNum());
            }
        }
    }
}
